function onOpen(evt) {
	console.log('womp open')
}

function onClose(evt) {
	console.log('womp discon')
}

function onError(evt) {
	console.log('womp error:' + evt.data)
}

function doSend(message) {
	console.log('womp send:' + message)
	websocket.send(message)
}

function initSocket(wsUri) {
	websocket = new ReconnectingWebSocket(wsUri)
	websocket.timeoutInterval = 10000;//连接超时时间
	websocket.reconnectInterval=5000;//重连间隔时间
	websocket.maxReconnectInterval = 600000;//最大重连间隔时间
	websocket.maxReconnectAttempts = 100;//最大重连尝试次数
	websocket.onopen = function(evt) {
		onOpen(evt)
	}
	websocket.onclose = function(evt) {
		onClose(evt)
	}
	websocket.onmessage = function(evt) {
		onMessage(evt)
	}
	websocket.onerror = function(evt) {
		onError(evt)
	}
}